package com.cjh.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cjh.mapper.OrderMapper;
import com.cjh.pojo.Order;
import com.cjh.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author cjh
 * @since 2020-12-23
 */
@Service
public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements OrderService {

    @Autowired
    private OrderMapper orderMapper;

    @Override
    public boolean insertOrder(Order order) {
        return orderMapper.insertOrder(order);
    }

    @Override
    public List<Order> selectOrdersByUserId(Integer userId) {
        return orderMapper.selectOrdersByUserId(userId);
    }

    @Override
    public List<Order> selectUntreatedOrders() {
        return orderMapper.selectUntreatedOrders();
    }

    @Override
    public Integer getOrderNumber(Integer userId) {
        return orderMapper.getOrderNumber(userId);
    }
}
